Core.Storage = function() {};

Core.Storage.prototype = {
	
	/**
	 * Clears singleton current state.
	 */
	__clear: function() {},
	
	/**
	 * Returns value from the given array path. 
	 * If path doesn't exist returns undefined.
	 * 
	 * @param String path
	 */
	get: function(path) {
		return Core.Storage.Raw.get(path.split("."));
	},
	
	/**
	 * Sets value at the end of the array path.
	 * If path doesn't exist - creates it.
	 * Sets NP's listeners corresponding to the given path as dirty.
	 * 
	 * @param String path
	 * @param Any value
	 */
	set: function(path, value) {
		Core.Storage.Raw.set(path.split("."), value)
	},
	
	/**
	 * Registers listener under given array path.
	 * @param String path
	 * @param Function fn - listener
	 */
	register: function(path, fn) {
		Core.Storage.Raw.register(path.split("."), fn);
	},
	
	/**
	 * Unregisters listener from the given array path.
	 * @param String path
	 * @param Function fn - listener
	 */
	unregister: function(path, fn) {
		Core.Storage.Raw.unregister(path.split("."), fn);
	}
};

Core.Storage = Singleton.register("core.storage", Core.Storage);